import * as Base from './base/example.jsx';
import CodeView from '../../../shared/components/CodeView';
import { getDisplayElementById } from '../../shared/helpers';

<div className="doc lead">
  Prompt notice grabs the user’s attention & alerts them of system-related issues/updates.
</div>

<CodeView exampleOnly>
  { Base.default }
</CodeView>

## About Prompt
A prompt uses the [base modal component](/components/modals) and then adds the class `.slds-modal_prompt` to the overall `.slds-modal`. The utilities > themes > colors class is placed on the `.slds-modal__head` to create the color of the header. In the example, we illustrate using `.slds-theme_error`. The class `.slds-theme_alert-texture` should be applied to create the striped gradient. The `.slds-modal__footer` receives the class `.slds-theme_default`.

### Implementation Guidelines

#### Markup

Expected markup is the same as Modals (/components/modals), but with the following differences):
- Modal has `role="alertdialog"`
- Modal has an `aria-describedby` attribute that matches the id of the modal message container.
- Modal message container container should have `tabindex="0"`

#### Keyboard Interaction

Expected keyboard interaction is the [same as Modals](/components/modals), with the addition of:
- Modal message container should take initial focus

### Accessibility
Prompt notifications are similar to modals, in that they are a focus trap, but they should take a slightly different `role` of `alertdialog` to indicate their severity. Like modals they should be labelled by their headings, but additionally they should be described by the message details of the prompt.

The element containing the prompt message should be the target focus of the browser when it is displayed, which is why we add `tabindex="0"` to `slds-modal__container`.

There is no requirement for a close button, as the confirmation button should be used to dismiss the prompt, along with the usual Esc key dismissal.

## Base

<CodeView>
  { Base.default }
</CodeView>
